import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[][] arr=new int[n][n];
        for(int i=0;i<n;i++){
            arr[i][0]=1;
            arr[i][i]=1;
        }
        for(int i=2;i<n;i++){
            for(int j=1;j<i;j++){
                arr[i][j]=arr[i-1][j]+arr[i-1][j-1];
            }
        }
        for(int i=0;i<n;i++){
            for(int j=0;j<=i;j++){
                System.out.printf("%5d",arr[i][j]);
            }
            System.out.println();
        }
    }
    public static void main1(String[] args) {
        String[] str={"XYZE","SFZS","XDEE"};
        String str1="XYZY";
        System.out.println(exist(str, str1));
    }
    public static boolean exist (String[] board, String word) {
        char[] ch=new char[word.length()];
        int num=board[0].length();
        int res=0,res1=0;
        for(int i=0;i<board.length;i++){
            for(int j=0;j<num;j++){
                if(word.charAt(0)==board[i].charAt(j)){
                    res=i;
                    res1=j;
                }
            }
        }
        int c=1;
        while(c<word.length()){

                if(res< board.length-1&&res1<num-1&&board[res++].charAt(res1)!=word.charAt(c)&&board[res--].charAt(res1)
                        !=word.charAt(c)&&board[res].charAt(res1++)!=word.charAt(c)&&board[res].charAt(res1--)!=
                        word.charAt(c)){
                    return false;
                }
            c++;
        }
        return true;
    }
}
